package jobs

import (
	"gitchina/CPTT4WeChat/data"
	"time"
)

func Start() {
	go func() {
		t1 := time.NewTimer(1 * time.Hour)
		for {
			select {
			case <-t1.C:
				hour := time.Now().Hour()
				if hour >= 0 && hour <= 5 {
					var repo data.ApiRepo
					repo.DailyClean()
					t1.Reset(1 * time.Hour)
				}
			}
		}
	}()
}
